package com.xqls.server.dto.send;

import com.xqls.server.dto.SoketCommonDto;
import com.xqls.server.netty.DecoderUtil;
import io.netty.buffer.ByteBuf;

import java.util.Date;
/**
 * 时间校准
 * @author Administrator
 *
 */
public class TimeCalibrationSamplingSetDto extends SoketCommonDto{
	 /**
     * 校准
     */
    public static  final  String CALIBRATION="0008";
    
    /**
     * 校准接收
     */
    private  String receive;
    
    /**
     * 校准时间
     */
    private Date  calibrationTime;


	public Integer getLength(){
		return 26;
	}
	public String getCode() {
		return "ca";
	}

	public String getReceive() {
		return receive;
	}

	public void setReceive(String receive) {
		this.receive = receive;
	}

	public Date getCalibrationTime() {
		return calibrationTime;
	}

	public void setCalibrationTime(Date calibrationTime) {
		this.calibrationTime = calibrationTime;
	}
    
	
	public void encode( ByteBuf byteBuf){
        byteBuf.writeBytes(DecoderUtil.hexStringToBytes(this.getReceive()));
		byteBuf.writeBytes(DecoderUtil.hexStringToBytes("0000000000000000000000000000"));
        DecoderUtil.toBCDDate(this.getCalibrationTime(), byteBuf);//时间
        super.encode(byteBuf);
    }

}
